<?php
if (!defined('APP_PATH')) {
	define('APP_PATH', $_SERVER['DOCUMENT_ROOT']."/bdACPA");
}
require_once(APP_PATH.'/required.php');

header("Content-type:text/xml");
echo("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
$idDossiers = split("%",$_REQUEST["idDossiers"]);
$out = "<rows>";
foreach ($idDossiers as $idDossier){
	if (trim($idDossier)!= null){
		$dossier = $DOSSIER_DAO->recupere_dossier_par_id_pour_tableau_recherche($idDossier);
		$out .= "<row id = '".$dossier[0]["iddossier"].".' >";
		$out .= "<cell>false</cell>";
		$out .= "<cell>".$dossier[0]["iddossier"]."^http://www.stephenking.com/the_author.html</cell>";
		$out .= "<cell>".$dossier[0]["numero"]."^http://www.stephenking.com/the_author.html</cell>";
		$out .= "<cell>".$dossier[0]["sexe"]."</cell>";
		$out .= "<cell>".$dossier[0]["categorie"]."</cell>";
		//	$pheno = $PHENTOYPE_DOSSIER_DAO->recuperer_phenotype_par_iddossier($idDossier);
		//	if (count($pheno)==0){
		//	$phenotypes = "non renseigné";
		//	} else {
		//		$phenotypes = "";
		//		foreach ($phenotypes as $phenotype){
		//			$phenotypes .= $phenotype->libelle.", ";
		//		}
		//		$phenotypes = substr($phenotypes, -2);
		//	}
		//	$out .= "<cell>".$phenotypes."</cell>";
		$out .= "<cell>phenotypes</cell>";
		$out .= "<cell>".$dossier[0]["typeprelevement"]."</cell>";
		$out .= "<cell>".$dossier[0]["marquepuce"]."</cell>";
		$out .= "<cell>".$dossier[0]["typepuce"]."</cell>";
		$out .= "<cell>".$dossier[0]["nbcnv"]."</cell>";
		$out .= "<cell>".$dossier[0]["formulechromosomique"]."</cell>";
		$out .= "<cell>".$dossier[0]["nom"]."</cell>";
		$out .= "</row>";
	}
}
$out .= "</rows>";
print($out);
?>